package com.xiaoxi.observermode.observer;

import com.xiaoxi.observermode.generator.NumberGenerator;

/**
 * @Author xiaoxi
 * @ProjectName design_mode
 * @PackageName com.xiaoxi.observermode.observer
 * @ClassName DigstObserver
 * @Description TODO
 * @Date 2023/3/27 15:46
 * @Version 1.0
 */
public class GraphObserver implements Observer {

    private char ch;

    public GraphObserver(char ch) {
        this.ch = ch;
    }

    @Override
    public void update(NumberGenerator numberGenerator) {
        int number = numberGenerator.getNumber();
        for (int i = 0; i < number; i++) {
            System.out.print(ch);
        }
        System.out.println();
    }

}
